UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RZpAHydpyq9FyzgBossjvKB8xbMYqIoz0FsF70QcGvw='
WHERE
key_id = 'b45ab7ff1faeff93a7d2a44885776e991511bbb1d37a8aed36a75873e8709a5f'
AND (
token = 'RZpAHydpyq9FyzgBossjvKB8xbMYqIoz0FsF70QcGvw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)