UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2nt8izSomR/EgUG3OWituWXY6PAag3W7I5BSS1Hrxzk='
WHERE
key_id = 'b4d66a90b1507bbbb16911077ea2f142976cd89e8ed3291b5c09b360faa40808'
AND (
token = '2nt8izSomR/EgUG3OWituWXY6PAag3W7I5BSS1Hrxzk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)