UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P+TnSEbvjZApzukwfyg4X00V2QTS7LjZH4+ZuRbL6oE='
WHERE
key_id = '95de60f3e3833973c48d2e888ab40da9af93d38648ec3a0da3009194e45700b6'
AND (
token = 'P+TnSEbvjZApzukwfyg4X00V2QTS7LjZH4+ZuRbL6oE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)