UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TDSy98Q8riBVx+tMlFK7rpIRjImnG67RDmclf66s/XY=' 
WHERE 
  key_id = 'acc1b75ad32fcb363d080363711f705e8e22e727ff5e1cc6372dbde4d038ca09' 
  AND (
    token = 'TDSy98Q8riBVx+tMlFK7rpIRjImnG67RDmclf66s/XY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044