UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fv6UqQOdGoGAPU3RwFsaPxAfSjxV+PYzv7TRLxWw6ZI=' 
WHERE 
  key_id = '1a55ec5cfb2e97810a8303b080ace7590f85e69ca99edc6506f06732562413ef' 
  AND (
    token = 'Fv6UqQOdGoGAPU3RwFsaPxAfSjxV+PYzv7TRLxWw6ZI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019