UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FL05YsPzEPDq/vXZiqDoMznRy4skx0aCV67wbzaGhxY='
WHERE
key_id = 'a177166214f5c22bd46561cc5cb1092d37208caf24e5611eeb0d9d6ca85b33db'
AND (
token = 'FL05YsPzEPDq/vXZiqDoMznRy4skx0aCV67wbzaGhxY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)