UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '63VOfzZLak+U/2n09gnbdLii7630McVmICQL3ffjiaI=' 
WHERE 
  key_id = 'b988630b9cfcad4b70421b257a6b7edc0d1259a9743a4fe8bf7d896da59dbc15' 
  AND (
    token = '63VOfzZLak+U/2n09gnbdLii7630McVmICQL3ffjiaI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041