UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GJIt5L1EBbyHt5fDcOSu0sX27xd8Xkuue41tBUQu8Cw=' 
WHERE 
  key_id = '051ce218ffc92d5160ef0b4b1c93aa0dcef34d045f90ce9bc860310fa358dbc8' 
  AND (
    token = 'GJIt5L1EBbyHt5fDcOSu0sX27xd8Xkuue41tBUQu8Cw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019