UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fSKuJX5uhhWDrVGoR2kYqLUoAzQjD+C9D81nqfHwJUI=' 
WHERE 
  key_id = '5c66f5545922c4f7f95546c35d0b762b7c3d00cb204a4c8db73d6eca39342640' 
  AND (
    token = 'fSKuJX5uhhWDrVGoR2kYqLUoAzQjD+C9D81nqfHwJUI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041