UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'maUFf2MyPGCrbq0PR0XKICXTRmSBHsrc+efS19ixDug='
WHERE
key_id = 'fe9099d4d9f6ba459e2599ed84dc7dab472d45862247c73914b95ed9e59c5520'
AND (
token = 'maUFf2MyPGCrbq0PR0XKICXTRmSBHsrc+efS19ixDug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)