UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GvLqvJFobdVHMdbZi9CvcsoiDmxBpYWeDoAYIJof4U4='
WHERE
key_id = 'ff034c67481eb104bba1dda876801663d892a946e20a40cd9a97bfc60e2ebbc3'
AND (
token = 'GvLqvJFobdVHMdbZi9CvcsoiDmxBpYWeDoAYIJof4U4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)