UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IyVJd0avvT5vfrt7q53sbHZZCgNEijO+nk5/Sr9GgEM='
WHERE
key_id = 'ee6aca51f3d24e7a1bade099eb6bfb796ded5993941fe1f74d03f97dfa706d8e'
AND (
token = 'IyVJd0avvT5vfrt7q53sbHZZCgNEijO+nk5/Sr9GgEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)