UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xyRiwBGhyW3pc2krUVdKch+/KrbNGgs1XjifGLqdEmc='
WHERE
key_id = '90d48c886e391b30d518ce719c88478db7e9cd87bf2418d9deef7a84bab6b3e9'
AND (
token = 'xyRiwBGhyW3pc2krUVdKch+/KrbNGgs1XjifGLqdEmc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)