UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OwjfV6qU50qW7v+Xh2DACN9tSjjTZnNow9SoRhIBjlA='
WHERE
key_id = 'a06886c91a4f90fe2d06d356e0dd513a1c10ccf5c703422c3ee9c66c3cba42b2'
AND (
token = 'OwjfV6qU50qW7v+Xh2DACN9tSjjTZnNow9SoRhIBjlA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)