UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4aPW3D8TRmtHJOYmDxdpUM5/L38ejNcF+ODsNLaY69E='
WHERE
key_id = '2f653c20d26095cb48914a177a3d6fe6abfaea9501d35b73931e720103156367'
AND (
token = '4aPW3D8TRmtHJOYmDxdpUM5/L38ejNcF+ODsNLaY69E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)