UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I+bU1lXV8dG8BE0rIkaRLa818yL/jtmWeniF4y+OASw=' 
WHERE 
  key_id = '2dcfd81fcc4fb091b9d8877032bb221d567b0ff2db789a58ee6035a8d7697c34' 
  AND (
    token = 'I+bU1lXV8dG8BE0rIkaRLa818yL/jtmWeniF4y+OASw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025