UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CJA/hGfmcaFNaKqZwhjgz7OzxYw9EHOZ1mfGzn3ckeM=' 
WHERE 
  key_id = '3f525dfc548e95cd91c5964a9f90ac2929eab422e3704ce01688a290be95409c' 
  AND (
    token = 'CJA/hGfmcaFNaKqZwhjgz7OzxYw9EHOZ1mfGzn3ckeM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049