UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QHPy6dRAvEX+BI7PShM2rMXD3xy/xpb0ecdWdS1Z4vY=' 
WHERE 
  key_id = 'bc860eb4d35c9d687af8fe507a2ad830aefb309c4c6430816dcaf0541cb6df28' 
  AND (
    token = 'QHPy6dRAvEX+BI7PShM2rMXD3xy/xpb0ecdWdS1Z4vY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049