UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LNklviyCqkjM0NigI9qmMunBF2UIF7GapJKnv9g8jpg='
WHERE
key_id = '353658793c0a8840b216779ee615a1f9962538051ea0f37fff39f60ec4687eae'
AND (
token = 'LNklviyCqkjM0NigI9qmMunBF2UIF7GapJKnv9g8jpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)