UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xEVA4/taa8WKqMpduOtBX01ZZK7qCgDTDPRrSeM5oTA='
WHERE
key_id = '0b83856f15a1039c1ba55a771682a6bfb946e445a5615e44dd7ca58391649f4a'
AND (
token = 'xEVA4/taa8WKqMpduOtBX01ZZK7qCgDTDPRrSeM5oTA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)