UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3pBVoY5mmzNSLf4k3d8s6QJSlv+ixtKZfHebo68cC5U='
WHERE
key_id = '3b20de60dbeb8b6e5a90e58e72e7f1037b5706da1d17a9b584902e2745043449'
AND (
token = '3pBVoY5mmzNSLf4k3d8s6QJSlv+ixtKZfHebo68cC5U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)