UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'epmIh6dedoYLW9d1qCbHi59Nh5KIFOdoaZ4QNBJ735c=' 
WHERE 
  key_id = 'e64008f937fb852810fa0de78e7611ca84d96bca331d607f3324dbe615db875a' 
  AND (
    token = 'epmIh6dedoYLW9d1qCbHi59Nh5KIFOdoaZ4QNBJ735c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033