UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k/yf9lJOhIwazpEnZMbD0iTXePrUb1SFYjSVLjOLIX0='
WHERE
key_id = '6c423b8b99e0e607e48ea6ca5162df293bf9da88b7c952ac99283b79496f38fa'
AND (
token = 'k/yf9lJOhIwazpEnZMbD0iTXePrUb1SFYjSVLjOLIX0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)