UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0UWnZoQvpAYhpvRt/B4QCeNpZXbgT/eTujXDPJGojaw='
WHERE
key_id = '4d9b46d946f0f796a139d6d641f6aaafedd4c9c051d0d895366b491545be5773'
AND (
token = '0UWnZoQvpAYhpvRt/B4QCeNpZXbgT/eTujXDPJGojaw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)