UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GFjBTNtFWs32HfthaT28YlncA+AwYouddBi0J2/dK3k='
WHERE
key_id = '2ed15cf51069bd1db617d707a7422a0d5898e542342d9a975a3ca7b93efb7bf1'
AND (
token = 'GFjBTNtFWs32HfthaT28YlncA+AwYouddBi0J2/dK3k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)