UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JNS7T/7CC+roXIcRKQ8BDEc5Ysj2B7mr2NsfLZr3ZUs='
WHERE
key_id = 'fc6356bd7d385265d3a818f541c7af460ecd4e2e9c4ed5be32f5d3340e360d8f'
AND (
token = 'JNS7T/7CC+roXIcRKQ8BDEc5Ysj2B7mr2NsfLZr3ZUs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)