UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UNd4BZ2SMWsDt2SuIrvLBQf0KyCkdpueoNW8bo0F45o='
WHERE
key_id = '77a1a4f3bcd375312456eb6cb13ca7d290cf711013ae3e1d84aabd75db732e5d'
AND (
token = 'UNd4BZ2SMWsDt2SuIrvLBQf0KyCkdpueoNW8bo0F45o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)