UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TuAwaXmDdmuwPZYXn9zFgfudIfofbp5XBU6T6nyuqhQ=' 
WHERE 
  key_id = 'd44bc4581bfd8a0b0fcc5a353e282d91d4c84987006f07dfca0fd3c136788f65' 
  AND (
    token = 'TuAwaXmDdmuwPZYXn9zFgfudIfofbp5XBU6T6nyuqhQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022