UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z91n8hxYXcpviTfYsPrju3RGWbpvbRkuq3AgZ3N/vUM='
WHERE
key_id = '34327ec3543f85c187d2a437e09b87e8077f3c41ad15ca4a70df9212ce451f24'
AND (
token = 'z91n8hxYXcpviTfYsPrju3RGWbpvbRkuq3AgZ3N/vUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)