UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yprdHZrMt86s6Huwk7mGAEzmnnut7kkMivM5Oy5C/bY='
WHERE
key_id = 'e90700a8ce11fe450ddc13b5e140913641bd817424c03a92d38a10b1c2f8e514'
AND (
token = 'yprdHZrMt86s6Huwk7mGAEzmnnut7kkMivM5Oy5C/bY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)