UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'axWDHsDg8IqV+cZXcqdBxyeMpBsa6rkk+v8+eN3r9T4='
WHERE
key_id = 'edc44811a7809e3d6333369d9885fd9adaac904afe4325412b0ba9620d66cf31'
AND (
token = 'axWDHsDg8IqV+cZXcqdBxyeMpBsa6rkk+v8+eN3r9T4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)