UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/HzDiUy3G02T6+jw+7h//QPKK/9dHT/YN+HsYOeA6XU='
WHERE
key_id = '9bb0189987f4af27135df2cb41ba4d2d420c3423526f25f26d4ed03e2f54a423'
AND (
token = '/HzDiUy3G02T6+jw+7h//QPKK/9dHT/YN+HsYOeA6XU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)