UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ym8+htyNLIqJeEhPnDCoF2GLg+xJbs1umDUsmRlZyCw='
WHERE
key_id = 'e188762cb1c6db3c8820e0f172b8e8cfad7057051176210c6a766aa71446a485'
AND (
token = 'ym8+htyNLIqJeEhPnDCoF2GLg+xJbs1umDUsmRlZyCw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)