UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ms6IiPeDayhC/mWWOM9ABT6l6OgPn69Hg3ZxOpI+2yo='
WHERE
key_id = 'fda0ee282fdcd6318129c7eaafa77174936fce4b38d7bbc1bbd68d7c710d4efb'
AND (
token = 'Ms6IiPeDayhC/mWWOM9ABT6l6OgPn69Hg3ZxOpI+2yo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)