UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zz5kXUxMvPk2iUkffMsTnF+RJK0k8gpBEWdQqUkrjdw='
WHERE
key_id = 'b10f63513db9c8c29f16e6510f66c42467f70beee506908a2476f58fb71df10c'
AND (
token = 'zz5kXUxMvPk2iUkffMsTnF+RJK0k8gpBEWdQqUkrjdw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)