UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JP3H4DRMytUYTyVE1dMiTcBHNnhEEYiE1dOdSLKWBEQ='
WHERE
key_id = '984d60c16f00fcf28b41f4b0d3f8fcfc77d5890c72de382b780ae55588e5e992'
AND (
token = 'JP3H4DRMytUYTyVE1dMiTcBHNnhEEYiE1dOdSLKWBEQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)