UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eEWJDP20uUeNugl8vulEpdESNTFaaHGDQRKaZa/m4A4='
WHERE
key_id = 'ed8b9c0570f513cb3840f9eb3b9b563edd611630ed445b536d88a00dc60a493e'
AND (
token = 'eEWJDP20uUeNugl8vulEpdESNTFaaHGDQRKaZa/m4A4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)