UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cvEruyR7ic7hf6gGg9gu92hjKd/uvnpyJEblSQZuDg0='
WHERE
key_id = '54d825728c1d37d49a8b5324b006eba2c107591b043dfb42892989e83531eddc'
AND (
token = 'cvEruyR7ic7hf6gGg9gu92hjKd/uvnpyJEblSQZuDg0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)