UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7OE8jPOlE9qvEWug7id9ilbRnIfuyTib9rHuPEdiTe4='
WHERE
key_id = '27ee4e4cbbccafcc0dadcdd20d6482c2ee418cd02f00244aa1d72618dfdd948b'
AND (
token = '7OE8jPOlE9qvEWug7id9ilbRnIfuyTib9rHuPEdiTe4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)