UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7S9sYCW+5H4jFsVfxavEO4oQQczvekXKwvntBKczTLI='
WHERE
key_id = '0f225cc89a0855d0b17b39807513463760c0811a2eb269bef2c8241e4cdb9c16'
AND (
token = '7S9sYCW+5H4jFsVfxavEO4oQQczvekXKwvntBKczTLI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)