UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6jtZ3jaZ743ujnL68GAz5MFkCiTwGl78vZZQrTANjWg='
WHERE
key_id = '2ab9fce72e5c9c8a899abf645548e1cef2beed0f75a5678c0af086ff33c5870c'
AND (
token = '6jtZ3jaZ743ujnL68GAz5MFkCiTwGl78vZZQrTANjWg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)