UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GWGzKG+/ogfTLNxZNXhSvZW1NS5eG703ijeXKxGNEFM='
WHERE
key_id = 'b577e4cfd842dbc17cc90e00bf623d2ad365beca7a1438fc3584a4bbcecdc24e'
AND (
token = 'GWGzKG+/ogfTLNxZNXhSvZW1NS5eG703ijeXKxGNEFM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)