UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NojLfXWk+1SrfXS0dIxOPKr6JqNH0oA9XVilH+wyj88='
WHERE
key_id = '81dd455cf57e30cbc008280617a58e24cdeff050a63a80463cdf4dbb0f5da97d'
AND (
token = 'NojLfXWk+1SrfXS0dIxOPKr6JqNH0oA9XVilH+wyj88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)