UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3hYszA/swTOqtbdXKcI/W9vRTU1KZm85ShaJ5yWHzUM='
WHERE
key_id = '32b1476bd00d89f45f0b58a56fdf21158f51715554b546ae7cb2dfcdb78aad83'
AND (
token = '3hYszA/swTOqtbdXKcI/W9vRTU1KZm85ShaJ5yWHzUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)