UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jVVSjvPpdDRmB0J6lmTahFgyT+cIkCn9viXcjqQQzG4=' 
WHERE 
  key_id = '669b4e6bf0cca07c837745c6fd2bcbd124faa70d6768d66a1fb6b0af82db2fc2' 
  AND (
    token = 'jVVSjvPpdDRmB0J6lmTahFgyT+cIkCn9viXcjqQQzG4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037