UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Idy3VV1U6rP/wjm5xz5Vn7T+T7ks2SfyY4oy3Wv5rY='
WHERE
key_id = 'b433e5c0058c620dc1a2f8d0eaca3d5c8314725863b56eeafbd9b042542a0799'
AND (
token = '3Idy3VV1U6rP/wjm5xz5Vn7T+T7ks2SfyY4oy3Wv5rY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)