UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8NCHbRAoBPvt/GkoDgO86E69abL0gBhexyk8LWn9ol8=' 
WHERE 
  key_id = 'dc08b09ec74a60594f9030d5aeb62c1ef194ce096132829002e798fb496efc7c' 
  AND (
    token = '8NCHbRAoBPvt/GkoDgO86E69abL0gBhexyk8LWn9ol8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055