UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FVaMZFYe/1EY9ks+v7lsnSI30A+Jbv2QUrh/nbS/u/k=' 
WHERE 
  key_id = '19386048031b6a6cd4c3e3a6ac51d136a32daef94200a38bd6e4da4920207b81' 
  AND (
    token = 'FVaMZFYe/1EY9ks+v7lsnSI30A+Jbv2QUrh/nbS/u/k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052