UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N9tIq7yQy/hWEXbtfIyTE2SqT4QJ2/AkCoDL9O0BDiY='
WHERE
key_id = '7c83480f4d6e4deddd62327a3d25dfb9907af73fdda4ecc0f47aa0625c657f9b'
AND (
token = 'N9tIq7yQy/hWEXbtfIyTE2SqT4QJ2/AkCoDL9O0BDiY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)