UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D2CJddsep41txhWdo6oBadheayB79U/615UBNktHM/0=' 
WHERE 
  key_id = '53c953de2d5244ac1311159253bca81117f8bba2e78184a0a96c0a1af82dc9f8' 
  AND (
    token = 'D2CJddsep41txhWdo6oBadheayB79U/615UBNktHM/0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021